package com.zhc.dejingapi.common.utils;

import cn.hutool.core.date.DateUnit;
import cn.hutool.core.date.DateUtil;
import org.springframework.context.annotation.Configuration;

import java.util.Date;

/**
 * @author zhc
 * @date 2024年03月16日 13:49
 */

@Configuration
public class DateTimeUtil {

    public long TillTheEndOfTodayWithSeconds(){
        Date date = DateUtil.date();
        Date endOfDay = DateUtil.endOfDay(date);

        return DateUtil.between(date, endOfDay, DateUnit.SECOND);
    }

    public String CurrentDateYYYYMMDD(){
        Date date = DateUtil.date();
        return DateUtil.format(date, "yyyyMMdd");
    }
}
